package com.sphd.restaurantsystem.presenter;


import com.android.volley.VolleyError;
import com.sphd.restaurantsystem.info.InvestorItemInfo;
import com.sphd.restaurantsystem.model.MonthAndDayModelImpl;
import com.sphd.restaurantsystem.view.MonthAndDayView;

import java.util.List;

/**
* Created by Hu on 2016/11/04
*/

public class MonthAndDayPresenterImpl implements MonthAndDayPresenter {
    MonthAndDayModelImpl monthAndDayModel;
    MonthAndDayView monthAndDayView;

    public MonthAndDayPresenterImpl(MonthAndDayView monthAndDayView) {
        this.monthAndDayView = monthAndDayView;
        monthAndDayModel=new MonthAndDayModelImpl();
    }

    @Override
    public void addData(String url) {
        monthAndDayView.showLoading();
        monthAndDayModel.sendUrl(url,this);
    }

    @Override
    public void sendError(VolleyError error) {
        monthAndDayView.dissLoading();
    }

    @Override
    public void sendRes(List<InvestorItemInfo> investorItemInfos) {
        monthAndDayView.receRes(investorItemInfos);
        monthAndDayView.dissLoading();
    }
}